3.5.80 \(\int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx\) [480]

3.5.80.1 Optimal result
3.5.80.2 Mathematica [B] (verified)
3.5.80.3 Rubi [A] (verified)
3.5.80.4 Maple [A] (verified)
3.5.80.5 Fricas [A] (verification not implemented)
3.5.80.6 Sympy [F]
3.5.80.7 Maxima [A] (verification not implemented)
3.5.80.8 Giac [A] (verification not implemented)
3.5.80.9 Mupad [B] (verification not implemented)

3.5.80.1 Optimal result

Integrand size = 19, antiderivative size = 104 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx=4 a^3 b x+\frac {b^2 \left (12 a^2+b^2\right ) \text {arctanh}(\sin (c+d x))}{2 d}+\frac {a^2 \left (2 a^2-b^2\right ) \sin (c+d x)}{2 d}+\frac {b^2 (a+b \sec (c+d x))^2 \sin (c+d x)}{2 d}+\frac {3 a b^3 \tan (c+d x)}{d} \]

output
4*a^3*b*x+1/2*b^2*(12*a^2+b^2)*arctanh(sin(d*x+c))/d+1/2*a^2*(2*a^2-b^2)*s 
in(d*x+c)/d+1/2*b^2*(a+b*sec(d*x+c))^2*sin(d*x+c)/d+3*a*b^3*tan(d*x+c)/d
 
3.5.80.2 Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(280\) vs. \(2(104)=208\).

Time = 1.23 (sec) , antiderivative size = 280, normalized size of antiderivative = 2.69 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx=\frac {\sec ^2(c+d x) \left (8 a^3 b c+8 a^3 b d x-12 a^2 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 a^2 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+b \cos (2 (c+d x)) \left (8 a^3 (c+d x)-b \left (12 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+b \left (12 a^2+b^2\right ) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\left (a^4+2 b^4\right ) \sin (c+d x)+8 a b^3 \sin (2 (c+d x))+a^4 \sin (3 (c+d x))\right )}{4 d} \]

input
Integrate[Cos[c + d*x]*(a + b*Sec[c + d*x])^4,x]
 
output
(Sec[c + d*x]^2*(8*a^3*b*c + 8*a^3*b*d*x - 12*a^2*b^2*Log[Cos[(c + d*x)/2] 
 - Sin[(c + d*x)/2]] - b^4*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + 12*a 
^2*b^2*Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + b^4*Log[Cos[(c + d*x)/2] 
 + Sin[(c + d*x)/2]] + b*Cos[2*(c + d*x)]*(8*a^3*(c + d*x) - b*(12*a^2 + b 
^2)*Log[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] + b*(12*a^2 + b^2)*Log[Cos[(c 
 + d*x)/2] + Sin[(c + d*x)/2]]) + (a^4 + 2*b^4)*Sin[c + d*x] + 8*a*b^3*Sin 
[2*(c + d*x)] + a^4*Sin[3*(c + d*x)]))/(4*d)
 
3.5.80.3 Rubi [A] (verified)

Time = 0.79 (sec) , antiderivative size = 103, normalized size of antiderivative = 0.99, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.579, Rules used = {3042, 4329, 3042, 4564, 3042, 4535, 24, 3042, 4533, 3042, 4257}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right )^4}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx\)

\(\Big \downarrow \) 4329

\(\displaystyle \frac {1}{2} \int \cos (c+d x) (a+b \sec (c+d x)) \left (6 a b^2 \sec ^2(c+d x)+b \left (6 a^2+b^2\right ) \sec (c+d x)+a \left (2 a^2-b^2\right )\right )dx+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \int \frac {\left (a+b \csc \left (c+d x+\frac {\pi }{2}\right )\right ) \left (6 a b^2 \csc \left (c+d x+\frac {\pi }{2}\right )^2+b \left (6 a^2+b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )+a \left (2 a^2-b^2\right )\right )}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 4564

\(\displaystyle \frac {1}{2} \left (\int \cos (c+d x) \left (8 b \sec (c+d x) a^3+\left (2 a^2-b^2\right ) a^2+b^2 \left (12 a^2+b^2\right ) \sec ^2(c+d x)\right )dx+\frac {6 a b^3 \tan (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \left (\int \frac {8 b \csc \left (c+d x+\frac {\pi }{2}\right ) a^3+\left (2 a^2-b^2\right ) a^2+b^2 \left (12 a^2+b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )^2}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+\frac {6 a b^3 \tan (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 4535

\(\displaystyle \frac {1}{2} \left (8 a^3 b \int 1dx+\int \cos (c+d x) \left (\left (2 a^2-b^2\right ) a^2+b^2 \left (12 a^2+b^2\right ) \sec ^2(c+d x)\right )dx+\frac {6 a b^3 \tan (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 24

\(\displaystyle \frac {1}{2} \left (\int \cos (c+d x) \left (\left (2 a^2-b^2\right ) a^2+b^2 \left (12 a^2+b^2\right ) \sec ^2(c+d x)\right )dx+8 a^3 b x+\frac {6 a b^3 \tan (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \left (\int \frac {\left (2 a^2-b^2\right ) a^2+b^2 \left (12 a^2+b^2\right ) \csc \left (c+d x+\frac {\pi }{2}\right )^2}{\csc \left (c+d x+\frac {\pi }{2}\right )}dx+8 a^3 b x+\frac {6 a b^3 \tan (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 4533

\(\displaystyle \frac {1}{2} \left (b^2 \left (12 a^2+b^2\right ) \int \sec (c+d x)dx+8 a^3 b x+\frac {a^2 \left (2 a^2-b^2\right ) \sin (c+d x)}{d}+\frac {6 a b^3 \tan (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {1}{2} \left (b^2 \left (12 a^2+b^2\right ) \int \csc \left (c+d x+\frac {\pi }{2}\right )dx+8 a^3 b x+\frac {a^2 \left (2 a^2-b^2\right ) \sin (c+d x)}{d}+\frac {6 a b^3 \tan (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

\(\Big \downarrow \) 4257

\(\displaystyle \frac {1}{2} \left (8 a^3 b x+\frac {b^2 \left (12 a^2+b^2\right ) \text {arctanh}(\sin (c+d x))}{d}+\frac {a^2 \left (2 a^2-b^2\right ) \sin (c+d x)}{d}+\frac {6 a b^3 \tan (c+d x)}{d}\right )+\frac {b^2 \sin (c+d x) (a+b \sec (c+d x))^2}{2 d}\)

input
Int[Cos[c + d*x]*(a + b*Sec[c + d*x])^4,x]
 
output
(b^2*(a + b*Sec[c + d*x])^2*Sin[c + d*x])/(2*d) + (8*a^3*b*x + (b^2*(12*a^ 
2 + b^2)*ArcTanh[Sin[c + d*x]])/d + (a^2*(2*a^2 - b^2)*Sin[c + d*x])/d + ( 
6*a*b^3*Tan[c + d*x])/d)/2
 

3.5.80.3.1 Defintions of rubi rules used

rule 24
Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4257
Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] 
 /; FreeQ[{c, d}, x]
 

rule 4329
Int[(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_))^(m_), x_Symbol] :> Simp[(-b^2)*Cot[e + f*x]*(a + b*Csc[e + f*x])^(m - 
2)*((d*Csc[e + f*x])^n/(f*(m + n - 1))), x] + Simp[1/(d*(m + n - 1))   Int[ 
(a + b*Csc[e + f*x])^(m - 3)*(d*Csc[e + f*x])^n*Simp[a^3*d*(m + n - 1) + a* 
b^2*d*n + b*(b^2*d*(m + n - 2) + 3*a^2*d*(m + n - 1))*Csc[e + f*x] + a*b^2* 
d*(3*m + 2*n - 4)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d, e, f, n}, x 
] && NeQ[a^2 - b^2, 0] && GtQ[m, 2] && (IntegerQ[m] || IntegersQ[2*m, 2*n]) 
 &&  !(IGtQ[n, 2] &&  !IntegerQ[m])
 

rule 4533
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*(csc[(e_.) + (f_.)*(x_)]^2*(C_.) 
+ (A_)), x_Symbol] :> Simp[A*Cot[e + f*x]*((b*Csc[e + f*x])^m/(f*m)), x] + 
Simp[(C*m + A*(m + 1))/(b^2*m)   Int[(b*Csc[e + f*x])^(m + 2), x], x] /; Fr 
eeQ[{b, e, f, A, C}, x] && NeQ[C*m + A*(m + 1), 0] && LeQ[m, -1]
 

rule 4535
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(m_.)*((A_.) + csc[(e_.) + (f_.)*(x_)]* 
(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.)), x_Symbol] :> Simp[B/b   Int[(b*Cs 
c[e + f*x])^(m + 1), x], x] + Int[(b*Csc[e + f*x])^m*(A + C*Csc[e + f*x]^2) 
, x] /; FreeQ[{b, e, f, A, B, C, m}, x]
 

rule 4564
Int[((A_.) + csc[(e_.) + (f_.)*(x_)]*(B_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_. 
))*(csc[(e_.) + (f_.)*(x_)]*(d_.))^(n_.)*(csc[(e_.) + (f_.)*(x_)]*(b_.) + ( 
a_)), x_Symbol] :> Simp[(-b)*C*Csc[e + f*x]*Cot[e + f*x]*((d*Csc[e + f*x])^ 
n/(f*(n + 2))), x] + Simp[1/(n + 2)   Int[(d*Csc[e + f*x])^n*Simp[A*a*(n + 
2) + (B*a*(n + 2) + b*(C*(n + 1) + A*(n + 2)))*Csc[e + f*x] + (a*C + B*b)*( 
n + 2)*Csc[e + f*x]^2, x], x], x] /; FreeQ[{a, b, d, e, f, A, B, C, n}, x] 
&&  !LtQ[n, -1]
 
3.5.80.4 Maple [A] (verified)

Time = 1.00 (sec) , antiderivative size = 96, normalized size of antiderivative = 0.92

method result size
derivativedivides \(\frac {a^{4} \sin \left (d x +c \right )+4 a^{3} b \left (d x +c \right )+6 a^{2} b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 \tan \left (d x +c \right ) a \,b^{3}+b^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(96\)
default \(\frac {a^{4} \sin \left (d x +c \right )+4 a^{3} b \left (d x +c \right )+6 a^{2} b^{2} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+4 \tan \left (d x +c \right ) a \,b^{3}+b^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(96\)
parallelrisch \(\frac {-12 \left (a^{2}+\frac {b^{2}}{12}\right ) \left (1+\cos \left (2 d x +2 c \right )\right ) b^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )+12 \left (a^{2}+\frac {b^{2}}{12}\right ) \left (1+\cos \left (2 d x +2 c \right )\right ) b^{2} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )+8 a^{3} b x d \cos \left (2 d x +2 c \right )+8 a \,b^{3} \sin \left (2 d x +2 c \right )+a^{4} \sin \left (3 d x +3 c \right )+\left (a^{4}+2 b^{4}\right ) \sin \left (d x +c \right )+8 a^{3} b x d}{2 d \left (1+\cos \left (2 d x +2 c \right )\right )}\) \(163\)
risch \(4 a^{3} b x -\frac {i a^{4} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i a^{4} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i b^{3} \left (b \,{\mathrm e}^{3 i \left (d x +c \right )}-8 a \,{\mathrm e}^{2 i \left (d x +c \right )}-b \,{\mathrm e}^{i \left (d x +c \right )}-8 a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}-\frac {6 \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2} b^{2}}{d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{4}}{2 d}+\frac {6 \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2} b^{2}}{d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{4}}{2 d}\) \(196\)
norman \(\frac {\frac {\left (2 a^{4}-8 a \,b^{3}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}}{d}+\frac {\left (6 a^{4}+8 a \,b^{3}-b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{d}-4 a^{3} b x -\frac {\left (2 a^{4}+8 a \,b^{3}+b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {\left (6 a^{4}-8 a \,b^{3}-b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{d}+8 a^{3} b x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-8 a^{3} b x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{6}+4 a^{3} b x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{8}}{\left (1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right ) \left (-1+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}\right )^{3}}-\frac {b^{2} \left (12 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b^{2} \left (12 a^{2}+b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) \(277\)

input
int(cos(d*x+c)*(a+b*sec(d*x+c))^4,x,method=_RETURNVERBOSE)
 
output
1/d*(a^4*sin(d*x+c)+4*a^3*b*(d*x+c)+6*a^2*b^2*ln(sec(d*x+c)+tan(d*x+c))+4* 
tan(d*x+c)*a*b^3+b^4*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+tan(d*x+ 
c))))
 
3.5.80.5 Fricas [A] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.25 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx=\frac {16 \, a^{3} b d x \cos \left (d x + c\right )^{2} + {\left (12 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (12 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (2 \, a^{4} \cos \left (d x + c\right )^{2} + 8 \, a b^{3} \cos \left (d x + c\right ) + b^{4}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \]

input
integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4,x, algorithm="fricas")
 
output
1/4*(16*a^3*b*d*x*cos(d*x + c)^2 + (12*a^2*b^2 + b^4)*cos(d*x + c)^2*log(s 
in(d*x + c) + 1) - (12*a^2*b^2 + b^4)*cos(d*x + c)^2*log(-sin(d*x + c) + 1 
) + 2*(2*a^4*cos(d*x + c)^2 + 8*a*b^3*cos(d*x + c) + b^4)*sin(d*x + c))/(d 
*cos(d*x + c)^2)
 
3.5.80.6 Sympy [F]

\[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx=\int \left (a + b \sec {\left (c + d x \right )}\right )^{4} \cos {\left (c + d x \right )}\, dx \]

input
integrate(cos(d*x+c)*(a+b*sec(d*x+c))**4,x)
 
output
Integral((a + b*sec(c + d*x))**4*cos(c + d*x), x)
 
3.5.80.7 Maxima [A] (verification not implemented)

Time = 0.20 (sec) , antiderivative size = 115, normalized size of antiderivative = 1.11 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx=\frac {16 \, {\left (d x + c\right )} a^{3} b - b^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 12 \, a^{2} b^{2} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, a^{4} \sin \left (d x + c\right ) + 16 \, a b^{3} \tan \left (d x + c\right )}{4 \, d} \]

input
integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4,x, algorithm="maxima")
 
output
1/4*(16*(d*x + c)*a^3*b - b^4*(2*sin(d*x + c)/(sin(d*x + c)^2 - 1) - log(s 
in(d*x + c) + 1) + log(sin(d*x + c) - 1)) + 12*a^2*b^2*(log(sin(d*x + c) + 
 1) - log(sin(d*x + c) - 1)) + 4*a^4*sin(d*x + c) + 16*a*b^3*tan(d*x + c)) 
/d
 
3.5.80.8 Giac [A] (verification not implemented)

Time = 0.33 (sec) , antiderivative size = 179, normalized size of antiderivative = 1.72 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx=\frac {8 \, {\left (d x + c\right )} a^{3} b + \frac {4 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + {\left (12 \, a^{2} b^{2} + b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (12 \, a^{2} b^{2} + b^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (8 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{2}}}{2 \, d} \]

input
integrate(cos(d*x+c)*(a+b*sec(d*x+c))^4,x, algorithm="giac")
 
output
1/2*(8*(d*x + c)*a^3*b + 4*a^4*tan(1/2*d*x + 1/2*c)/(tan(1/2*d*x + 1/2*c)^ 
2 + 1) + (12*a^2*b^2 + b^4)*log(abs(tan(1/2*d*x + 1/2*c) + 1)) - (12*a^2*b 
^2 + b^4)*log(abs(tan(1/2*d*x + 1/2*c) - 1)) - 2*(8*a*b^3*tan(1/2*d*x + 1/ 
2*c)^3 - b^4*tan(1/2*d*x + 1/2*c)^3 - 8*a*b^3*tan(1/2*d*x + 1/2*c) - b^4*t 
an(1/2*d*x + 1/2*c))/(tan(1/2*d*x + 1/2*c)^2 - 1)^2)/d
 
3.5.80.9 Mupad [B] (verification not implemented)

Time = 13.80 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.46 \[ \int \cos (c+d x) (a+b \sec (c+d x))^4 \, dx=\frac {a^4\,\sin \left (c+d\,x\right )}{d}+\frac {b^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {b^4\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {12\,a^2\,b^2\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {8\,a^3\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {4\,a\,b^3\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \]

input
int(cos(c + d*x)*(a + b/cos(c + d*x))^4,x)
 
output
(a^4*sin(c + d*x))/d + (b^4*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/ 
d + (b^4*sin(c + d*x))/(2*d*cos(c + d*x)^2) + (12*a^2*b^2*atanh(sin(c/2 + 
(d*x)/2)/cos(c/2 + (d*x)/2)))/d + (8*a^3*b*atan(sin(c/2 + (d*x)/2)/cos(c/2 
 + (d*x)/2)))/d + (4*a*b^3*sin(c + d*x))/(d*cos(c + d*x))